package nancal.mp.db.mongo.entity.dev

import nancal.mp.db.mongo.base.IndexCodeName
import nbcp.base.db.IdName
import nbcp.base.db.annotation.Cn
import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.db.annotation.DbEntityIndex
import nbcp.base.db.annotation.DbEntityIndexes
import nbcp.base.model.BaseMarkEntity
import org.springframework.data.mongodb.core.mapping.Document

@Cn("产品线")
@Document
@DbEntityGroup("dev")
@DbEntityIndexes(DbEntityIndex("code", unique = true))
open class ProductLine(
    @Cn("产品线名称") var name: String = "",
    @Cn("编码") var code: String = "",
    @Cn("备注") var remark: String = "",
    @Cn("产品经理") var lm: IdName = IdName(),
    @Cn("项目经理") var pm: IdName = IdName(),
    @Cn("开发经理") var leader: IdName = IdName(),
    @Cn("开发人员") var developers: MutableList<IdName> = mutableListOf(),
    @Cn("集群") var cluster: IndexCodeName = IndexCodeName(),
) : BaseMarkEntity() {
    val clusterCode: String
        get() {
            return this.cluster.code
        }
}